package cn.itsy.dao;

import cn.itsy.pojo.User;
import cn.itsy.pojo.Warninfo;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

@Repository
public class LoginUserDaoImpl implements LoginUserDao {
    @Resource
    private JdbcTemplate jt;

    @Override
    public List<Warninfo> UserAll(String sql) {
        List<Warninfo> userList = jt.query(sql, new BeanPropertyRowMapper<Warninfo>(Warninfo.class));
        return userList;
    }

    @Override
    public void updept(String sql) {
        jt.update(sql);
    }
}
